import frida
import sys

rdev = frida.get_remote_device()
session = rdev.attach("今日热榜")

scr = '''
Java.perform(function () {
    // 先找到目标类
    var b = Java.use('today.tophub.app.utils.b'); // 替换为实际的类路径
    b.a.implementation = function (aVar) {
        console.log(typeof aVar);
        console.log('参数为aVar: ' + aVar);

        var result = this.a(aVar); // 调用原始函数
        console.log('返回值为: ' + result);
              
        console.log(Java.use("android.util.Log").getStackTraceString(Java.use("java.lang.Throwable").$new()));
        return result;
    };
    
});
'''

script = session.create_script(scr)


def on_message(message, data):
    print(message, data)


script.on("message", on_message)

script.load()
sys.stdin.read()


